
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* init and exit */

#define STATE_OK 1
#define STATE_BAD 0

int init_head(int arg)
{
    int done = 0;
    if (arg > 10)
        done = STATE_OK;
    else
        done = STATE_BAD;
    return done;
}

void exit_head(int state)
{
    if (state)
        printf("exit with OK\n");
    else
        printf("exit with BAD\n");
}

int print_head(int state)
{
    if (state == STATE_OK)
        printf("init done\n");
    else
        printf("init bad\n");
    return state;
}

int main(int argc, char *argv[])
{
    exit_head(print_head(init_head(20)));
    return 0;
}
